//
//  Contact.m
//  01-GitHomeWork
//
//  Created by dllo on 16/7/4.
//  Copyright © 2016年 QC.L. All rights reserved.
//

#import "Contact.h"

@implementation Contact
-(instancetype)initWithName:(NSString *)name phoneNum:(NSString *)phoneNum {
    self = [super init];
    if (self) {
        _name = name;
        _phoneNum = phoneNum;
        _groupName = [[name substringToIndex:1] uppercaseString];
        
    }
    
    return self;
    
}

+ (instancetype)contactWithName:(NSString *)name phoneNum:(NSString *)phoneNum {
    
    return [[Contact alloc]initWithName:name phoneNum:phoneNum];
}

- (NSString *)description {
    
    return [NSString stringWithFormat:@"%@  %@",_name, _phoneNum];
}







@end
